package com.ThreadStudy.State;

import java.text.SimpleDateFormat;
import java.util.Date;

public class PrintSystemTime {
    public static void main(String[] args) throws InterruptedException {
        int count = 0;
        boolean flag = true;
        while (flag){
            // 打印当前系统时间
            Thread.sleep(1000);
            System.out.println((++count)+"次打印::--->"+(new SimpleDateFormat("HH:mm:ss").format(new Date())));

            // 让它暂停
            if(count==10){
                flag = false;

            }


       }
    }
}
